<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <header id="header">
        <div class="left">
            <a href="#"><img src="http://chst.vip:8081/for-stu/wfzh/images/header_logo.png" width="70" alt=""></a>
        </div>
        <div class="right"><a href="#"><img src="../images/header_app.png" alt="" width="34"></a>
        </div>
    </header>
    <section id="search">
        <div class="searchbox">
            <input type="text" name placeholder="请输入你想比价的产品">
        </div>
        <div class="button">
        </div>
    <div class="container">

    </div>
</body>
</html>
<script>
    let uu=document.querySelector('.container')
    let el=""
    fetch('http://chst.vip:1234/api/getcategorytitle')
    .then(body => body.json())
    .then(res=>{
        console.log(res)
       let r=res.result
       console.log(r)
       r.forEach(item => {
           console.log(item.title)
           el+=`
       <li>${item.title}</li>
       `
       });
      uu.innerHTML=el;
      
    })
   
   fetch('http://chst.vip:1234/api/getcategory?titleid=${item.titleId}')
   .then(body=>body.json)
   .then(res=>{
       console.log(res)
   })
</script>